from django.db import models

# Create your models here.
class course_manage(models.Model):
    gender1 =  ((0,'是'),(1,'否'))
    gender2 =  ((0,'笔试'),(1,'实践'))
    id = models.IntegerField(primary_key = True)
    course = models.CharField(max_length=16)
    teacher_id = models.IntegerField()
    price = models.FloatField()
    price_bool = models.CharField(max_length=16,choices = gender1 )
    test_way = models.CharField(max_length=16,choices = gender2)
    video_time = models.FloatField()
    number = models.IntegerField()
    # add_time = models.DateTimeField(auto_now_add=True)
    update_time = models.DateTimeField(auto_now=True)


class teacher_manage(models.Model):
    teacher_id = models.IntegerField(primary_key = True)
    name = models.CharField(max_length=16)
    tel = models.IntegerField()
    # add_time = models.DateTimeField(auto_now_add=True)
    update_time = models.DateTimeField(auto_now=True)


class major_manage(models.Model):
    gender = ((0,'在线'),(1,'未上线'))
    id = models.IntegerField(primary_key = True)
    major = models.CharField(max_length=16)
    level = models.CharField(max_length=16)
    colleges = models.CharField(max_length=16)
    course_num = models.IntegerField()
    provice = models.CharField(max_length=16)
    status = models.CharField(max_length=16,choices = gender)
    sort = models.IntegerField()
    add_time = models.DateTimeField(auto_now_add=True)
    update_time = models.DateTimeField(auto_now=True)

class User(models.Model):
    """ 用户表 """
    name = models.CharField(max_length=128, unique=True,default='')
    password = models.CharField(max_length=256,default='')
    email = models.EmailField(max_length=100, unique=True,default='abc@email.com')




